<html> 
<head> 
	<meta charset="utf-8"> 
	<title>helloweba.com</title> 
</head> 
 
<body> 
	<h1>iframe B</h1>  
	<p id="hello">Helloweb.com</p>  
	<input type="text" id="iframeB_ipt" name="iframeB_ipt" value="1,2,3,4"> 
	<button onclick="child4parent();">iframeB子窗口操作父窗口</button>  
	<button onclick="child4child();">iframeB操作子窗口iframeA</button></br>
</body> 
<script type="text/javascript"> 
	function child4child(){ 
		var parentDOM=parent.getIFrameDOM("wIframeA"); 
		parentDOM.getElementById('hello').innerHTML="<span style='color:blue;font-size:18px;background:yellow;'>看到输入框里的值变化了吗？</span>"; 
		parentDOM.getElementById('iframeA_ipt').value = document.getElementById("iframeB_ipt").value; 
		parent.document.getElementById("result").innerHTML="子窗口iframeB操作了子窗口iframeA";
	} 
	function child4parent(){ 
		var iframeB_ipt = document.getElementById("iframeB_ipt").value; 
		parent.document.getElementById("result").innerHTML="<p style='background:#000;color:#fff;font-size:15px;'>子窗口传来输入框值：<span style='color:#f30'>"+iframeB_ipt+ "</span></p>"; 
	} 
</script> 
</html>